package com.example.pojo;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Past;
import java.util.Date;

/**
 * Created by Administrator on 2016/9/23/023.
 */
public class Employee {
    private Integer id ;
    @NotEmpty
    private String lastName;
    @Email
    private String email;
    private Integer gender;
    private Deparment department;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Past
    private Date brith;

    public Employee() {
    }
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public Employee(Integer id, String lastName, String email, Integer gender, Deparment department) {
        this.id = id;
        this.lastName = lastName;
        this.email = email;
        this.gender = gender;
        this.department = department;
    }

    public Deparment getDepartment() {
        return department;
    }

    public void setDepartment(Deparment department) {
        this.department = department;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "id=" + id +
                ", lastName='" + lastName + '\'' +
                ", email='" + email + '\'' +
                ", gender=" + gender +
                ", department=" + department +
                ", brith=" + brith +
                '}';
    }
    public Date getBrith() {
        return brith;
    }
    public void setBrith(Date brith) {
        this.brith = brith;
    }
}
